<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>乐队专辑和歌曲信息</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f9;
            color: #333;
            margin: 0;
            padding: 20px;
        }

        h2 {
            color: #28a745;
            text-align: center;
            margin-bottom: 20px;
        }

        h3 {
            color: #007bff;
            margin-top: 20px;
            margin-bottom: 10px;
        }

        h4 {
            color: #555;
            margin-top: 15px;
            margin-bottom: 10px;
        }

        p {
            margin: 10px 0;
            color: #666;
        }

        ul {
            list-style-type: none;
            padding: 0;
        }

        ul li {
            background-color: #fff;
            margin: 10px 0;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        hr {
            border: 0;
            height: 1px;
            background: #ddd;
            margin: 15px 0;
        }

        form {
            background-color: #f9f9f9;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            margin-top: 15px;
        }

        label {
            font-weight: bold;
            color: #555;
            display: block;
            margin-bottom: 8px;
        }

        input[type="text"],
        input[type="date"] {
            width: 100%;
            padding: 10px;
            margin-bottom: 16px;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-sizing: border-box;
            font-size: 14px;
        }

        button[type="submit"] {
            width: 100%;
            padding: 10px;
            background-color: #28a745;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }

        button[type="submit"]:hover {
            background-color: #218838;
        }

        .messages {
            margin-bottom: 20px;
        }

        .messages ul {
            list-style-type: none;
            padding: 0;
        }

        .messages ul li {
            padding: 10px;
            border-radius: 4px;
            margin-bottom: 10px;
            text-align: center;
        }

        .messages .success {
            background-color: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }

        .messages .error {
            background-color: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }

        .messages .warning {
            background-color: #fff3cd;
            color: #856404;
            border: 1px solid #ffeeba;
        }

        .messages .info {
            background-color: #d1ecf1;
            color: #0c5460;
            border: 1px solid #bee5eb;
        }
    </style>
</head>
<body>

<h2>{{ session['username'] }}的乐队专辑和歌曲信息</h2>

<!-- 错误消息 -->
<div>
    {% with messages = get_flashed_messages() %}
    {% if messages %}
    <ul>
        {% for message in messages %}
        <li>{{ message }}</li>
        {% endfor %}
    </ul>
    {% endif %}
    {% endwith %}
</div>

<!-- 展示乐队的所有专辑及其下的歌曲 -->
{% for album in albums %}
<h3>{{ album[0] }} ({{ album[1] }})</h3>
<p>{{ album[2] }}</p>

<h4>歌曲列表:</h4>
<ul>
    {% for song in album_songs[album[0]] %}
    <li>{{ song[0] }} - {{ song[1] }} - ({{ song[2] }})</li>

    <hr>


    {% endfor %}

    <h4>添加歌曲</h4>

    <form action="/get_all_album" method="POST">
        <input type="hidden" name="album_name" value="{{ album[0] }}">
        <label for="song_name">歌曲名称:</label><br>
        <input type="text" id="song_name" name="song_name" required><br><br>

        <label for="song_writer">歌曲作曲者:</label><br>
        <input type="text" id="song_writer" name="song_writer" required><br><br>

        <label for="song_release">歌曲发布日期:</label><br>
        <input type="date" id="song_release" name="song_release" required><br><br>

        <button type="submit">添加歌曲</button>
    </form>
</ul>

<!-- 添加歌曲按钮及表单 -->

{% endfor %}




</body>
</html>
